<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>

    // 实现一个myEvery方法达到内置every效果

        function myevery(arr,fn) {
            var newarr = [];
            for (var i = 0; i < arr.length; i++) {
                var res = fn(arr[i],i,arr)
                if(res!=true){
                    return false;
                }else{
                    continue
                }     
            }
          return true;
        }
        

        var str = '123456';
        arr = str.split("");
        var a = myevery(str,function(value,key,arr){return value <= 6;})
        console.log(a)





    </script>
</head>

<body>

</body>

</html>